home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 2,801 to 2,900 / aol-file-protocol-4400-2801-to-2900.zip / AOLDLs / C++ Files Library / FFT and Complex Numbers Library / FFTLibrary.sit / FFT library ƒ / Complex ƒ / ComplexNumbers.cp next >
Text File  |  1995-01-15  |  424b  |  26 lines

  1. //
  2. //    File: ComplexNumbers.cp
  3. //    Copyright ⌐1994-1995 James Wilson
  4. //    All rights reserved.
  5. //    
  6. //    This file implements the complex number functions.
  7.  
  8. #ifndef __COMPLEXNUMBERS__
  9. #include "ComplexNumbers.h"
  10. #endif
  11.  
  12. FP_TYPE Abs(const Complex& z)
  13. {
  14.     return sqrt(z.Re()*z.Re()+z.Im()*z.Im());
  15. }
  16.  
  17. FP_TYPE Arg(const Complex& z)
  18. {
  19.     return atan(z.Im()/z.Re());
  20. }
  21.  
  22. Complex Conj(const Complex& z)
  23. {
  24.     return Complex(z.Re(), -z.Im());
  25. }
  26.